package com.ruoyi.omp.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.omp.api.domain.ZsCustomer;
import com.ruoyi.omp.api.factory.RemoteCustomerFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author: cjie
 * @description: 客户信息服务
 * @date: 2021/8/16
 */
@FeignClient(contextId = "remoteCustomerService", value = ServiceNameConstants.OMP_LIFE_SERVICE, fallbackFactory =
        RemoteCustomerFactory.class)
public interface RemoteCustomerService {

    /**
     * 修改客户信息
     * @param zsCustomer 客户信息
     * @return
     */
    @PostMapping(value = "/zsCustomer/updateCustomer")
    R updateCustomer(@RequestBody ZsCustomer zsCustomer);

    /**
     * 通过客户id获取客户信息
     * @param customerId 客户Id
     * @return
     */
    @GetMapping(value = "/zsCustomer/getCustomer/{customerId}")
    R<ZsCustomer> getCustomer(@PathVariable("customerId") String customerId);


    @GetMapping(value = "/zsCustomer/getCustomerByName/{customerName}")
    R<ZsCustomer> getCustomerByName(@PathVariable("customerName") String customerName);


    /**
     * 增加客户信息
     * @param zsCustomer 客户信息
     * @return
     */
    @PutMapping("/zsCustomer/addCustomer")
    public R addCustomer(@RequestBody ZsCustomer zsCustomer);
}
